package com.xjtu.project.aichat;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.spring.AiService;
import dev.langchain4j.service.spring.AiServiceWiringMode;
import reactor.core.publisher.Flux;

//IOC容器中bean对象的名字如果没有指定那么就是类名首字母小写
@AiService(wiringMode = AiServiceWiringMode.EXPLICIT
        ,streamingChatModel = "openAiStreamingChatModel",tools ="salesTool",chatMemoryProvider = "chatMemoryProvider")
public interface ChatService {
    //@SystemMessage("你是一个java后端开发工程师")可以生成系统消息
    @SystemMessage(fromResource = "system.txt")
    Flux<String> chat(@UserMessage String message, @MemoryId String memoryId);
}
